/*
 * DatabaseDriver.java
 *
 * Created on December 15, 2007, 4:26 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.fie.database;

import java.sql.ResultSet;

/**
 *
 * @author joseacuna-rohter
 */
public class DatabaseDriver {
    
    public static void main(String[] args){
        Connector c = Connector.myConnector;
        
        char[] b = {'q','p','z','m', 'a','l','g','h'};
        System.out.println(c.logIn("tonyacunar",b));
        
        System.out.println(c.logIn("tonyacunar",b));
        
        c.getWatchList(2);
        
        System.out.println(c.getCustomerID("tonyacunar"));
        
       System.out.println(c.getCustomerBalance(2));
       
       //c.purchaseStock(2,"MSFT",5,32.00f,"2007-01-02");
        
       
       ResultSet rs = c.getActivePositions(2);
       try{
            while(rs.next()){
               System.out.println(rs.getString(1) +" "
                       + rs.getString(2)+" " + rs.getString(3) + " " + rs.getString(4)
                       + " " + rs.getString(5) + " " + rs.getString(6));
            }
       }
       catch(Exception e){
           
       }
       
       //c.sellStock(2,"AAPL",1);
       
       
       c.purchaseStockTwo(2,"AAPL",3,144.00f,"2007-01-01",300);
       
        
    }
    
}
